package com.xc.pattern.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xingchen
 * @description 容器简化版
 * @create 2022-09-11 19:42
 */
public class MyCollection implements ICollection {

    private List list = new ArrayList();

    @Override
    public void add(Object obj) {
        list.add(obj);
    }

    @Override
    public void remove(Object obj) {
        list.remove(obj);
    }

    @Override
    public Iterator iterator() {
        return new ConcreteIterator(list);
    }
}
